package com.usian.user.controller;

import com.usian.common.vo.ResultCommonVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2023 11 22 10 32
 **/
@RestController
@RequestMapping("/user")
public class UserController {
    @GetMapping
    public ResultCommonVo login(String username, String password){
        try{
            HashMap<Object, Object> objectObjectHashMap = new HashMap<>();

            if(username.equals("admin")&& password.equals("admin")){
                objectObjectHashMap.put("code",1);
                objectObjectHashMap.put("msg","success");

            }
            return ResultCommonVo.success(objectObjectHashMap);
        }catch (Exception e){
            e.printStackTrace();
            return ResultCommonVo.error(null);
        }


    }
}
